package com.yyn.pigeon.controller;


import com.yyn.pigeon.config.R;
import com.yyn.pigeon.entity.Goods;
import com.yyn.pigeon.entity.OrderDetail;
import com.yyn.pigeon.entity.Orders;
import com.yyn.pigeon.service.OrdersService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;

import javax.jws.Oneway;
import java.util.List;

/**
 * <p>
 * 订单表 前端控制器
 * </p>
 *
 * @author yyn
 * @since 2023-03-16
 */
@RestController
@RequestMapping("/pigeon/orders")
public class OrdersController {
@Autowired
private OrdersService ordersService;
@ApiOperation("订单页面")
@GetMapping("index")
    public R toOrders(String userId){
    List<OrderDetail> orders = ordersService.toOrders(userId);
    return R.success().data("orders",orders);
}
}

